Bugfixes for TAPModelManager, and tests