Low level type checking helpers.