Fixed issues #783,#779,#765,#762