Fixed bugs for test