Added better handling for type hinting errors