Correctly check for numeric values