Code sync and 'renameDocument' fixed