Fix small bug, and speed things up a lot.