Fixed annoying type generation wrong sequence

Hi,

This is a minor fix for a problem I introduced. Namely, before the first build a class complains about a missing SubModel type, that is declared below it.

I moved it up.

Thanks!