Fixed a bug in removing tags from TagHandler.