Fixed writeContinue and small bug