Fixing all remote ref issues