Fixed the bug of boundary and small pulse