Updated exceptions to be py3 friendly.