fixed many of the code warnings.