Implement a few more functions, handle more errors