Correct regression from incorrect merge

After a bad merge a lot of my modification are gone, so I have to readd them.
This Pull Request is here for that.