nicer error messages for bad parameters to toInt and toFloat