fix some minor bug
fix various bugs