Fixing the read/write bug.