Fixed to "actually" working version after merging with upstream/master.