Backport pr #33 into 0.9.x

Fixes #35.
Can you change the above lines to store `len(alignedPoints)` in `lenAlignedPoints` like @timob does in L657 of #81? I imagine that has to be a bit more efficient.