Bug fixes and features

Fixes #107 
Fixes the cause of the bug from #109 and starts work on a feature