Fixed secondary key creation and added test for pop method.