Fix memory leak in 675d0c6 + other patches

The commit removed a required "storageBuffer.RemoveRange()" call that resulted in an infinite loop of allocating memory.