Logic changes in several places.