Fix edit mode errors