Bug update

Fixes for #2 and #4