Make sure models array has unique list of models

Otherwise it piles up duplicates from previous calls and affects performance severely.

Fixes #161.