fixed issue 1631:elements(..., replace=None) deletes the first element only