Texture loading and bugfixes