bug fixes and manuel improvements to generated files