(*) General fixes.

(*) Fix some nasty substring code.