Created by: tsenart
#3097 was merged into another branch by mistake. This PR is meant to merge it to master.