Should fix up some of the problems with the modal.