Improvements to dev branch

Several minor fixes.