Fixes for issues #31, #32, and other minor tweaks