Fix bug where only one sheet and keep_prefix is activated