Fixed bugg in gcd that occured if both arguments had negative value.
Added unit test for gcd.