Dev into master

This fixes a number of things.