Fixed some tp bugs