I'm a self-employed IT guy at the moment. My self discipline is quite decent usually, I plan and think a lot before implementing something. I got stuck at some point now, because I didn't foresee a small detail and need to fix it at many points of my project now (should require me 2-3 working days to fix). For the last 4-5 days my coding productivity hit the bottom, I went on to deal with other parts of the project such as graphics, sound effects. But as you can imagine it is not a permanent solution, I have to go back to coding and fix the issue.
I know after it is fixed, I will get back to my previous pace. Any ideas how to motivate myself? Looking back at past I found myself in this situation a couple of times sometimes dropped the project sometimes it took me 2-3 times more time. Anybody found himself/herself in a similar situation and has a working solution?