Check for linenumber class

fixes #1897