I have been alerted to a mistake in a (mathematical) paper that I published about 8 years ago, during my PhD. The error is relevant, in the sense that it affects one of the claims made in the main result, but does not invalidate the rest of the paper. After some effort, I now also know how to correct the error.
So one course of action would be to submit a 'correction note' to the journal where the article was published.
On the other hand, since the time the paper was published also my understanding of the topic has matured a bit. In hindsight I would write the paper somewhat differently, I have had some related ideas that were not included in the original paper and finally I am also not convinced that my choice of journal was optimal.
So another course of action would be to write a new paper, including the corrected result and some new additional results and submit it to a different journal.
What course of action would be best, from an ethical and from a scientific point of view?