  For any quiver $Q$ and dimension vector $v$, Le Bruyn--Procesi proved that
the invariant ring for the action of the change of basis group on the space of
representations $\textrm{Rep}(Q,v)$ is generated by the traces of matrix
products associated to cycles in the quiver. We generalise this to allow for
vertices where the group acts trivially, and we give relations between the
generators of the invariant algebra for quivers with relations. As a geometric
application, we prove for $n\geq 1$ that the Hilbert scheme of $n$-points on an
ADE surface singularity is isomorphic to a Nakajima quiver variety. This allows
us to generalise the well known theorem of [Fogarty] by showing that the
Hilbert scheme of $n$-points on a normal surface with canonical singularities
is a normal variety of dimension $2n$ with canonical singularities. In
addition, we show that if $S$ has symplecic singularities over $\mathbb{C}$,
then so does the Hilbert scheme of $n$-points on $S$, thereby generalising a
result of Beauville.
