BUG: wrong code for some models.

Also added backwards compatibility for some special cases