Fixed texture segfault