Implement missing functions - still segfaulting at end