Fixed boundary condition bug