Improved transform_object to keep track of ME fields