Fixed: modals were not properly destroyed when clicking 'x' or 'anywhere'