Cleanups for #1657
Merge pull request #1660 from ussuri/small-fixes

Cleanups for #1657