Fix #722 and fix #724