deque: catch null pointer when dumping; add count to dump