Made sure all returned promises are resolved or rejected.