Add jkratoch's cleanup fixes.