Merging r780:786 from trunk to branches/0.3. Plus some work-in-progress.