Small fixes in matrices