Remove unused function
Fix tag handling issues