Fixed #586