Better handle null and undefined strings