Remove unnecessary (int) casts and fix style