Fixed more regressions, beginning to add multi-type functionality.