made some improvements for dealing with practice sessions (which might stop after one block) and fixed a bug that arose when the number of trials is less than a full block