Fixed crash when removing max amount of items via the stack manager.