Fix allocation

The current test would allocate 500 more items
EACH TIME the function is called!

Fixes #1