Fixed a small bug in the texture loader