You might want to change your iteration times.
Try the following:
1. Define a set of tasks well enough that someone else could do them without asking many questions.
2. Then, execute a single task without changing it, even if you change your mind midway through.
A "task" is equivalent to an hour or two of work.
When it's all done, do this process again for new features/changes.
This is good for the following reasons:
1. Separate out the thinking/analysis phase and the coding phase. This forces you to think things through before implementing them.
2. Modifying something is usually easier once it's already done. Also, you'll likely make few or no redundant modifications.
3. It makes you more aware of the time cost activities have, since you're splitting them up into several hour chunks instead of hundreds of unorganized several minute actions. You can better manage and prioritize 1-5 tasks rather than "whatever comes up".
This is very similar to Scrum, but for an individual developer.