fixes at save as button

Are you sure about this change?  I mean the Save.php script can return error messages. I understand you do not want to redirect when it is finished but maybe you should check the response to make sure you are being asked to redirect and if not (in case of an error) then show the message.