Fixed a bug that pop is not working. and added some useful primitives.