Fix some debug message problems.
Tighten up inner loops of PGS solver by eliminating element access overhead.