Fixed issues #656,#682,#679,#429