Minor improvements and 111 179 166

Minor improvements in javadoc and code structure

Also:
Fixes #111, fixes #169 and perhaps #179 (need to check)