Add new test. Fix bugs on the regression in MiningModel.