fix some boundary condition bugs