Minor bugfixes in the type validation parts.