Improved readability and some slight error handling.

Thought I'd just go ahead and update them tonight :)