Improve projection handling
Merge pull request #700 from mysema/i697

Improve projection code generation