OK, I've figured it out. It was a bug in the cloud mechanism, but not directly related to city building. In the cloud code, I have a line that if a tile is in the table of tiles replaced by clouds, and does not have a cloud on it itself, then it should get the terrain improvements stored in the table, since that must mean the terrain was changed with a cloud on it. To deal with another bug, I decided not to delete entries in the table, thinking it would do no harm to keep them, even if not needed. I'll try to get a fix out tonight. At the moment, this means that no tile that has ever had a cloud over it can have its improvements changed, which is undesirable. Was there a reason we were removing terrain improvements from cloud tiles other than aesthetics?