Ensure the boundary conditions actually show up in the nonlinear solve, and deal with some whitespace pedantry.
Fix a couple more typos, and use union1d instead of unique.
After this change, nonlinear solves with strong boundary conditions appear to work.