fixed a bug causing problems with exceptionally large datasets. Still
not entirely sure what causes it, but this solves the symptoms at least.