Fix BatPervasives.undefined

Otherwise the failwith (which got type string -> ('b -> 'c) here)
will be evaluated when the message parameter is passed.
Now it gets type 'a -> 'b and is evaluated only when both parameters are passed.
Merge pull request #352 from madroach/master

Fix Pervasives.undefined for use case with optional parameter