Fix bugs introduced into add/edit flow.