+1. Thank you for fixing this.
Your patch didn't apply cleanly to trunk, so I rebased it. In addition, I replaced the temporary file in the test with ByteArrayInputStream. Since PigServer.registerScript() accepts InputStream, it seems better to avoid to create a temporary file. Let me know if you think otherwise.