fixed bug in __trigsimp; added tests