Add check_partition and fix_partition script.