Fixed bug causing crash in Editor