Fix traceback when ID declaration is numeric (2014.1 branch)

Fixes #15913