Several tiny changes to cleanup code.