Fixed issue when trimming fields and the field is null.