backport of 696b4e5ded7e5ee3ac240d997a6cff5d027dc4a0 from trunk, closes #594 (and includes the CHANGELOG entry this time!)