fix some null problems.