Fixing more AD bugs.