Fixed java testing issues