ACHTUNG: this commit is probably broken. I had no time to check it.