Annotations added and some cleanup.
Cleanup.
Added missing javadoc tags.
Replaced the empty expression with a better visibible one.
Null check added
(note: however,  i'm not sure if that special case may happen in reality)
Replaced the if-test with a return test.
Merge pull request #477 from offa/some_fixes

Some code improvements