Fix for CRAFTERCMS-18 and CRAFTERCMS-19.

- Fix for CRAFTERCMS-18 and CRAFTERCMS-19.
- Added more javadoc.