Merge pull request #2197 from RosettaCommons/everyday847/sidechain_rebuild_hotfix Avoid weird mainchain condition