Prevent the screen from freezing in several places.