Issue 9 8

Fixes issues #8 and #9.