Fix bug #797