Changes from alexeyxo:master