Fix traceback when ID declaration is numeric

Fixes #15913
Merge pull request #16003 from terminalmage/issue15913-2014.1

Fix traceback when ID declaration is numeric (2014.1 branch)