a few tweaks and bugfixes
Merge pull request #1 from porterjamesj/master

a few tweaks and bugfixes