There's logic in the template to append an underscore to generated property name, if it's the same name as the table. This causes problems if you also are using that property as a key, because it won't be able to find that foreign key (without the underscore).
My patch/fix is located here: https://gist.github.com/nicholashead/268de71988667631bf5a
Comments: V2.8.1 released
My patch/fix is located here: https://gist.github.com/nicholashead/268de71988667631bf5a
Comments: V2.8.1 released