fix some potential problems.
4 files changed