Fixed issue #48 where duplicate sort indexes would occur when appending to top instead of the bottom