Cleanups and trying to trace down a performance issue.