Fixed possible texture loading bug