Readtag cleanup, memory leak fix