Fixed according to comments, added more tagging related functions.