Fix leader field and delete some redundant codes