Cleaned up some mesh transformation functions.