upstream-like fix