Updated to use modal/modeless alerts where appropriate.