Port to master of commit aa843e2.. from Aleksander Chumakov: