Add support for overriding the guess_type function.