Fixed bugs with the type validator and disable the validator if sphinx autodoc is running