Some changes and cleanup