Fixed logical error with removing items