Fix isEmpty() and count()

isEmpty() need not rely on peek(which is intended for consumer use) and instead compare head to tail.
count() should stop counting at max int to avoid wrap.