JD Motorsport's Josef Kral clinched his first win of the season in round nine of the International Formula Master before Russian Sergey Afanasiev ended his 14-month winless streak in Budapest.