[fix] Improved clean up to prevent crashes when you don't have a server or transformer.