A bunch of changes

Carry over the recent changes from bitbucket files.