update python linalg api and small fixes