Fix writeCentered method.