Minor changes

Bunch of minor changes to fix minor issues and fixes #131