Fixed problem caused by Matrix inversion.