Fixing Read/WriteMatrix