Fix segmentation fault in spline initialization. Fix vector allocation problem