Fix for https://github.com/facebook/hhvm/issues/2781