Integrate upstream

I haven't tested it.