Fixed problem with fields named 'type'.