Fix #790 #791