fix for dealing with non positive definite points in learning