Merge pull request #14 from cbecker/master

Fixes PCA (issue #13) and adds necessary tests