Fixed #614
Merged from #625