Knapsack without replacement no longer crashes, and fix test cases