Revert bug 999604 and remove now-redundant cleanup code