Fix bugs introduced with modals in previous commit.