General maintenance and cleanup (#7469)