Backports (fixes #473)