Fixed unforgivably stupid bug with 'type'.