Type hinting

More fixes @DeepDiver1975 @icewind1991 @bantu