Many bug fixes. Validated all gradients. Checked optimal solution for a simple example.
Principal curves: removing commented out code.