Fix #246 in stable0.6.