Added proper path and fixed indexing of posteriors