Error Fixes

Fixed a bug which let the JVM crash if the error handler can't handle an
error. Also fixed some minor style issues at calling points.