backport of bfe9171c2c14d2d1ca9e21bcfb0d810c28a37ae5 from trunk, closes #670 (and includes the CHANGELOG entry this time!)