small clean-up in Main, and minor corection in Id Validation