fix small bugs in tagging