Assert possible NPE and add missing Javadoc.