Backout bug 812417 "Pull request #944 from ochameau/bug812417"

This reverts commit b7111ece7367bea97d1582b935cd6bca2101fc85, reversing
changes made to 8ba3879d832ecb554e27147e77bd4060b5bb70b8.