various global variable fixes in editor