Support iterating over the different bases

And fix the encoding issue that suddenly became obvious.