Fixed bugs. All tests are pass.