Various minor fixes of early work: namespace declarations, doseqs from loops.