sync with upstream, fixes