Fixed bugs in pipline.