XXX: fix peek/pop