Potential NPE fixed, javadocs added.
Merge remote-tracking branch 'origin/master'