Fixed some things and ran goformat.
Merge pull request #3 from scottjab/fixcrash

Fixed some things and ran goformat.