Slightly saner error handling (thanks to AppCode for insisting)