FIX: wrong code for some models.

Also added backwards compatibility for some special cases