Fixes #116, #115, #103, #98.
Merge pull request #117 from travelton/master

Fixes several outstanding issues