@fuenfundachtzig that's odd, it worked for me with the test document yiu gave, the whole class is verging on unusable though so some issues not surprising. What happens if you simply remove the redefinition of \document and \enddocument (any real fix should start with that)