inconsistent types patch from upstream