Fixing up the modal stuff