Fixed bugs in knapsack01 impelmentation.