Cleanup and fixes modal exit on edit