Fix generate.py

Long templates were cut off.

Change-Id: I216ab670235cac67a48ca4deda3ba5520db282f8