Some minor speedups