Prevent TypeError

Stop throwing errors (Cannot call method 'match' of undefined) when typing non-numeric characters.