bugfixes in tracking logic