Fixed cursor NPE when files array becomes full