[WIP] Codegen errors

- [x] Remove duplication of interfaces
- [  ] Write test to duplication of interfaces
- [  ] Fix fatal errors
- [  ] Write test to prevent regressive bug of fatal errors