fix issue where click elsewhere will close save as dropdown but not cancelling save as mode

plus a few other minor changes