Summary: update javadoc to specify NPE as well as fix minor bug in implementation. Reviewed-by: alanb