- fixed a bug where theorem references were not being processed properly