Fix #569
Fix #578
Fix #579