fix types
(transplanted from eec14a745dd738a98cfb83e86a2b077d4280e314)