v2.1. Added more checks for empty strings.