Fixes for bugs 77565, 77562 and 79839, and other minor changes.