Fix #768; Fix #810