Minor cleanups and fix depreciation warnings.