Added error handling and fixed a number of visual issues with the mesh editor