Prettied up formatting, added additional error prevention
Merge pull request #191 from mistergone/master

Prettied up formatting, added additional error prevention