Updated the Write To disk test and fixed s trivial bug in write to disk