Clean up and fix vairous warnings.