fixed bugs #717, #732