fix types
(transplanted from eec14a745dd738a98cfb83e86a2b077d4280e314)
placate dialyzer
merge stable into default