Checks for valid numbers