Edited to improve handling of different numvols per session