Applied patches from RT tickets 45212, 32449, 32448, 32447. Fixed typoo in RT ticket 38456, added print_queue sub.