Push and at functions now fully working and no memory leaks