small fixes for dark_matrix correction