fix to allow programs with no internal subprograms
fixed definition of 'main' programs to allow 'contains' block- a few other tweaks@