Improve debug output by not letting large arrays run on forever