Bug fix - issue #7 and #9

See description in issues #7 and #9.

Thanks,
Eric.