Cleaned up crappy queue limit coding (mine).

(previously got right result, but was unnecessarily perverse)
Recoded queue limiting logic from scratch.