fixed argument and matrix errors