Fixed to work out target name correctly when source == '.'