Changed reordering function: now correctly reorders surveys with misplaced pages and avoid creation of multiple sheet with the same questionnaire_id.