Fixed bug in regularize BCs