various syntax fixes

especially catching ambiguous else warnings and missing parentheses in cases where || and && are used.

On second thought, I probably should have filtered out removal of rcsid[] declarations. 
You can keep those if you want.

It compiles much more quiet with -pedantic -Wall now.