Fixed #678
Fixed #702