hack to make functional when there are no queues.

If you dont have any queues, the plugin exits non zero, instead it should supply 0. 
This not very elegant code, any suggestions?