Fix for a few issues

* Issue #186 
* Issue #189 
* Issue #199
* Issue #200