Fixed tags

Fixed tags and some minor bugs, secured inserting