Fixed crash in model edit