Fixed bug with texture rendering.