Fixed a bug caused by '(NIL) as the initial queue