Use double quotes for empty string check, fixed function not found