Improved readability and some slight error handling.
Merge pull request #1 from lkvnstrs/readability_updates

Improved readability and some slight error handling.