Fixed Matrix Inverse Bug