some more cleanup, and also fixed some bugs with tagging and deletion of tags