Added trim() and test class; fixed comment.