Fix bug with bagging code, removed unused / duplicate code.