Patch by Eike yet somehow got lost on phabricator a year ago and never merged - rebased by me just now