Type checking functions.