Got lsqnonlin working. Rejoice.