You can always give a fixed quote which contains specified parameters. Of the three things that you listed that caused the overage, underestimating the time needed for testing is one which the client might rightfully feel is on you. The main reason that a client wants a fixed quote is because the person performing the circumstances should know what the normal range of time for the service is and bill accordingly. If you set the number right, sometimes things will go a little faster than expected and sometimes they will go a little slower, but on average you should be within an acceptable range.
The third item sounds like the client should have been responsible for the consequences of the changes, as well as for the changes themselves. That situation is not uncommon. A minor change can often cause a ripple effect - if a builder moves a door at a client's request after already laying the flooring, the cost should include not only cutting the new doorway and filling in the old, but also the cost of reworking any flooring.
The first issue should also be the client's unless being a perfectionist means not letting errors slide by that you consider minor. If you made changes and he just wanted something different, then you can solve that by saying that you will include x set of changes. Anything over that allowed number is extra. I recently had a logo done by a designer and that was his arrangement. I got two sets of changes. It was up to me to make sure I communicated what I wanted. As long as he followed my directions, if I wanted to tweak the final set again, that was on me. Obviously, if he didn't follow my instructions, I would not have considered the unacceptable final set to be my problem but his. You have to deliver what you promise.