Fixed bugs during testing