fix exception types in some specs
Merge pull request #350 from ptomulik/fix/spec_exceptions

fix exception types in some specs