fix a few corner cases with type-hinting