Fix exception message regexp
use correct form
Merge pull request #358 from pyr/fix-two-bugs

Fix two bugs