es_source: fix for finite length souce with (set_max(N)), add QA test to verify this