Added statement error handler

Also added a second bernoulli_with_..._errors for testing.