Clean up substitutions. Add a few more substitutions I missed. Don't crash on incorrect line number entry.