Cleanup (mirrored from 1.2 branch).