Fix server stop when instance is null