Fixing issue where calling chain.then(null, ……) would throw an error.