It's price work, that's it unfortunatley. I would suggest getting a good contract, with a clause in there saying 'if any extra or unforseen work is required in order to complete the work ordered, this work will be charged for accordingly. Any faults that are detected which require rectification will incur a standard fault findiung charge of ** per hour'. I always put in my contract, though, that I will contact the customer where possible before starting extra work, you won't get a good name slapping extra charges on there when the work's finished. As someone else said, though, you have to be prepared to put everything back and go home without pay, you then have to ask yourself how much the extra work is going to cost you. I usually find i can clear faults etc in about an hour, so rarely charge, at least for finding them, obviously I would charge if they needed channelling out or whatever to be rectified (yesterday, in fact, a guy's strappers were knackered on a lighting job. He asked what could be done, I said trunking or digging out the wall. 'Or', I said jokingly, 'I could disconnect it and you could only use the landing light from upstairs. Chuckle.' He decided that would be OK!! So I didn't charge him).
I find a lot of the time, to be honest, if you seem to be having trouble or you clear a few faults, people may give you extra anyway, so you get what the work is worth and a good reference. If you slap all the charges on at the end of the job, you may get the money, but you won't get the word-of the mouth.
At the end of the day, though, it's like pablo says, if you're finding yourself consistently out of pocket, maybe you should have a look at reassessing the way you charge and/or the way you work.