fixed stuff I accidentally broke by the intensive usage of the Matrix class