Close #958
Fix #1199