Add basic support for rejected promises