fix #6. Now code generation compiles the code to find any syntax errors.
fixed an error in entity template which was found after running the test.