Fixed #731 and fixed #728