Handle invalid pop sequences

Change-Id: I2b88e51f52dff6e4a9f95fd058a8bce8de191504