some linalg fixes