Added some code for dealing with Harvestcraft dupping. Changed the logic so that useful slots are filled before the inventory.