And this is the last pull request from the list of bugs

@berentdaan This is a pull request of the same bug, but applied directly to the master branch now.