Minor performance optimizations to the promising loop, plus some more.

Minor performance optimizations to the promising loop.
Fixed so that it doesn't count and compare with undefined/NaN.
Also fixes a very very edge case where a update would fit perfectly but still be discarded from the list.