Changed remove_xxx to pop_xxx(), updated unittests accordingly