Changed exception handling so runtime errors don't lead to System.exit