Merged https://github.com/bitcoin/bitcoin/pull/3652