another bug fix(issue437: lost log record) and code clean up
6 files changed