Fixed put/remove/commit logic.