More compiler fixes and deleted redundant solve_matrices function