updating merge operations for the new env + store memory model
some more fixes. Need extensive testing now