Fixed many bugs in pca_project