Merge pull request #125 from RagnarHauge/CRA-505

Cra 505 Cra-708 mostly fixed, case 1 now runs ok on linux test suite.
CRA-708: Fixed unexpected writing of prior correlations.
Merge branch 'CRA-708' into CRA-505