made error handling more consistent and added exit function
added exit_toxic function (for real this time)
more error handling
Unnecessary casting
Merge pull request #33 from JFreegman/master

made error handling more consistent and added exit function