Cleanup error messages and some Javadoc.