fixed some mistakes in pca_lib