Implement more functions, fix init segfault.