Bugfixes and preliminary TM search.