Apply Keith Bourgoin's change: https://github.com/Parsely/Petrel/commit/9aca6e0ca6e1cb0af3335256e62c6e2bac8ddae7