Fixed deleting refs in local remotes not working anymore

See #2729 for details.