Bug #6 and a logic fix

- Closes #6
- Fixed an issue in GenTable where the generated code could use the
wrong conversion method