Updated bad trial detection