Fix definition creation and record edition