Fix range-loop-errors
These are indeed mistakes made by me because at the time I thought the reference was implied when using auto.