Corrected isHermitian and isSymmetric implementations