Fix for #32
Fix for #28
Fix for #41
Merge pull request #42 from JonnyHeavey/master

Various minor bug fixes.