Handle errors a bit better