"backporting" #170 into 0.9.x