Terminate made more robust in all implementing classes. Documentation
added for Program.