fixed issues #613, #614, #615