Fix issues pointed out by CodeClimate