Fix tagging bug and minor changes