Jacobian only working for half-space