Extended Euclid and LCM. Also updated some tests