HasTextureCoords and HasVertexColors are used as for-loop termination condition.
for( unsigned int a = 0; pMesh->HasTextureCoords(a); a++)
This works until a mesh has an empty uv slot. If a mesh has uv channel 0 and 2, the previous loop will terminate on index 1.
The right code should be:
for( unsigned int a = 0; AI_MAX_NUMBER_OF_TEXTURECOORDS; a++)