Minor code refactoring, and change PCA behavior for NULL values in matrices to be consistent with SVD