Clean up error messages for invalid edges; correct deselect behavior when clicking on the background.