gh-939

this PR happens to include a bunch of changes that made directly to master, now merged back to dev