Issue9

Update with fixes for #9