Add return value handling during path states merging