Generator : Re-fixed nasty bugs

Shame on me for not taking enough care while merging my own branch