My thinking is that you rendered your low chlorine inneffective with the high pH. It's puzzling how your Alk ever got to 40 but I doubt it had much influence on your algae.

I would suggest shock as well but would bring the Cl to 16ppm to insure you reach breakpoint. Holding it there a day or so will almost surely clear your water. Keeping your pH and Alk and Cl in line will probably keep your water clear the rest of the Summer