Fixed #807
Fixed #808