Fixes #1748: code cleanup.