several fixes and features

I saw you dealing with issue #12 and #10.  I may have resolved these in some recent changes.