Fixed texture rendering, even though it seems a bit dirty. At least it now works.