Previous changes introduced some bugs to the code generation scripts and templates, which now have been fixed.