gui.Object.toArray always returns an array.
Account for gui.MODE_MANAGED.