Fix bugs for key_name param