backporting a79053 to hydro-devel to fix #389

I haven't tested it (I have no idea how to test), but it's exactly what Dirk did in the indigo branch...