Small bugfixes in theory parsing