Bug fix and test
Added a test for push and pop