Fixing texture setting bug