Changed get_model to raise an exception on errors.

Returning None on errors led to unpythonic code, as the changes in this
commit show.