Added unit tests for new-style model directories and fixed issues.