Fixed an issue in tag2file