fix two bugs by lzk