Catch TypeError on number conversion