Fix javadoc and formatting.
Add null aware trim.