fixed compilation (warnings) and some minor cosmetic issues.