Add speedups for issue 259