fixed issues #631, #632