Added a check for null fraction_matrix
Fixed all the risk tests