add missing return to shlr/java/main.c
fix two off-by-one errors