Additional changes to handle null and zero length strings.