fixed error in whitespace trim functions