[WIP] Codegen errors

- [x] Remove duplication of interfaces
- [x] Fix fatal errors
Why did I even write this? :-/