Fix #670.
Fix #668.
Fix  #669