Add missing terms to adjoints_ex3

Patch from Vikram Garg