Complete previous fix (7afd4aac)

There were other places where we had the bug.
Merge pull request #1971 from vuntz/master

Complete previous fix (7afd4aac)