Populate resend queue
Fixed unsigned problems and bug in shouldResend checking function