Fixed a bug so that mip-mapping sometimes is not activated