Moved glClientActiveTexture and glActiveTexture calls before glEnable(GL_TEXTURE_2D) to make sure texture unit 0 gets affected. (#523)