Fixes #8: ensure array is always large enough