Add some more error checking

There is a price for not liking exceptions :D