diff --git a/lib/jqueue.py b/lib/jqueue.py
index 3cf3b428762be1b26b4e509fc63fb34c2e819d33..d5ea3cb79b81d5bc7e8d36a5079227d6605d9724 100644
--- a/lib/jqueue.py
+++ b/lib/jqueue.py
@@ -1798,7 +1798,8 @@ class JobQueue(object):
     @return: a string representing the job identifier.
 
     """
-    assert count > 0
+    assert ht.TPositiveInt(count)
+
     # New number
     serial = self._last_serial + count