Fixed problems in FunctionEditor causing exceptions when running a Scene