Fixed problems when trials are not numbered consequtively