fix issues reported by code inspection