- fix some issues pointed out by VS code analysis.