Fixing prepared queries when node was down