Fixed some issues discovered when building java API example program