#79 fix, #72 fix and multiple other changes

Multiple fixes, some refactoring and updating javadoc. 'nuff said.