Fixes for modal hiding