Fixes to doubled contracts from @jonhiga.
Use @anntzer's patch for doubled contracts.