Fixed bugs so test pass now