Cleaned up parameter substitution.
Additionally collect lowercase surfaceform counts.