Allocate sufficiently large storage arrays for endpoints

This fixes an index-out-of-bounds error reported in PR #93.
Merge pull request #95 from bska/allocate-endpoint-arrays

Allocate sufficiently large storage arrays for endpoints. Merging this as it is a fix for a critical bug.