Fixed TypeError when rendering ModelState with multiple bases.

I added a test for the error and simplified the existing one a bit.