Small fixes to tt.py