Fix model rules generation

If several fields had the same type, array keys were overwritten.