Replacement selection working.
Added separate tests for replacement selection, no replacement selection; max num. elements processed corrected