Issue #3148427 by Project Update Bot, Nathaniel: Drupal 9 compatibility fixes. Some other code cleanup.