Fix some typos, optimize more stuff and add benchmarking.