Quick fixed error handlers. Needs a proper refactor.