several minor bug fixed