Reverted some state tracking changes
Fixed merge implementation