Moving on to the CBLAS interface. Fixed bug.

Test didn't take NaN in account, optimization didn't stop when line search failed