Provide correct program name in error messages

Affects Windows only. Super old bug, been there for 4 years!