Fix some timing issues on tests