fixes from the upstream