Fix some bugs in MTT.

angle computation