gh-3397

This is a slight cleanup of #3397, put here for testing before commit.

Closes #3397.