fix huge texture leak in tiledef

fix minor glitches too