Minor optimization and type accuracy of some editor functions.