add set max result+ fix code style (#1106)