Fixed a logical error in the Mesh class.