Fix style, string convertion into integer and conditions