fix issue #614
fix issue #613
Merge pull request #615 from hustcalm/develop

Fix issue #613 and issue #614