Fixes to doubled contracts from @jonhiga.