Fixed possible NPE if a tag is lightweight.