Little tagging improvement

Database tagging improvement. Solved bug : if two tagging operations are done in the same datetime, the last one overrides the first and a tagging version is lost.