Fixes to get java example code working.