Bug in pop() method fixed.