More sorting and cleanup.