Cleaned up unused code and warnings.