Fixing some testing after refactoring the source codes.