Fix the 'do you want to leave this page' prevention to work again.