bug fixes, java code follow-ups