Fix #569 (close #671)