Fixed most of the warnings.