Minor changes in the writer and the caller