Merging locals in a more predictable way