fixed bug in ts.canon() and tests