test improvements and speedups