various cleanups and one fix after merge
Merge branch 'master'