Fixed a typo and a bug with recursive lookup of models. Include unit tests for the new models method