Miscellaneous fixes
Merge branch 'master' into master_cleanup