Small improvements to the code dealing with action queues