Improve tests
Fix log message
Add JavaDoc