Cleaned up code, removed warnings.