Fixed problems in FunctionEditor that caused exceptions when running a Scene