Update AFG code. Again. Maybe work?