Add tags functionality and some fixes