This fixes #8319.  It now checks for empty arrays both in load, and in factory.