Clear duplicate promise rejections

Fix #238

Also fixes test to correctly report fix (the fixed test still fails without the fix)