Fix problem with "null" appended to the string