Several minor upgrades fixes #67 fixes #41