Made error handlers more common (not sure if I should be instead raising exceptions)