Fixed a minor bug in texutre loading for unmanaged code.