Added limiting array size to make perl 5.21.3+ happy