some fixes for syncing between client and server

When the inventory was being changed outside the gui the itemstacks were
not being synced to client.