Fix #663
Fix #662
Fix #661
s