Cleaning code a bit; fixing errors throwing upon a dialog cancel