Diff rot

This merges #550 into a feature branch.