Bugfixes for the type validation feature.
Removed the old-style validation code.