added boundary flux jacobian calculation, and bug fixes