Removed debug code, fixed java error handler