More cleanup of chaining code.