Rename and preserve tags containing # so they can be used