Fixed to return 1 for an empty string