Fix lots of timing bugs