#1 and other fixes

Provided a possible fix for Issue #1, and a few other small bugs.