Improvements to intertrial interval, various small fixes