Addresses PR #196. Makes sure Promise is only completed once, either for failure or success.