Fixes to pass AD example.