fixing bug in AFC code, working apple AFC tests