Trim extraneous stuff before working on chaining rules.