Fixed some bugs.
Tags output mode: implemented and tested.