fix error composition
fix merge ordering
fix test race condition