Bug fix and move package refactoring of test code.