fix some runtime error.