Fixed GMM problem and added new test cases