When a limit is set on the number of backup files allowed to persist it just eliminate the first one, not all required.
Example
There is a limit of 50 files
Then it is change to 25
When backup finish, it deletes the first one so there will be 49 files. It should delete firs 25 files