Fix for Issue #13: some minor java issues

Here are the fixes: the first fixes a compile error, and the second a test failure. If they're OK, it would be great if you could accept them soon; I've more changes in the pipeline!