Cleaned up code to remove warnings.