Fixed refs/remotes/ handling

...and refs/tags/ (to be discussed - but does not harm).