Fixing a few bugs; adding some loggers for exceptions; adding more JavaDocs.