Fixed induced bug in triangleMath and added invalidType Test