merging in fixes to the queue code so they can be tested