Make the queue monitor more robust, and better debug output

Created by  Eelco Dolstra  on June 15, 2015
GKZN4UV75GV7GEHQGBM2O6UHN6CVSHA7BMASCUQSDIDYVUKKZL7AC
Change contents