Many fixes
Fixed tests
Fixed code coverage
Merge pull request #347 from GrahamCampbell/fixes

Many Fixes