Fix texture loading crash