Completed type checking and conversion functions.