Merge pull request #747 from alex/exception-heirarchy-refactor

Try to use more specific exceptions in places.