Corrected issues reported by klockwork