fix some crashes related to improper texture-size var used