Adding support for index updates in _put and cleaned last patch