Final OS X fix for Java 7 and a few other changes to improve error handling.