Added a fix for when trim receives a null value (bug #1395).