Fix NameError when ValidatePregnum fails

The error handler was failing with NameError instead of returning False.