Import from @mwild1's repo

Signed-off-by: Vadim A. Misbakh-Soloviov <mva@mva.name>