Fixed issues reported by Prevent static analysis tool