Cleanup and hostname sanitization