Properly handle empty strings