fixed several ttt bugs