Cleaned the code to remove warnings.