Fixed #742 and fixed #740