Fix crash when no instances are available