fixed sscanf slowness
added error handling to parse_number