many bugfixes, esp to TAPModel