Prevent duplicate names by appending an incremented prefix.