some cleanups and fixups
Merge pull request #1 from ignatenkobrain/patch-1

some cleanups and fixups