Something to consider: if you're billing by the hour, your clients aren't paying for a product, they're paying for you. Would you expect a company that hired you for a salary to dock your wages for time spent bug-fixing?
Make it entirely clear and transparent what you're working on, including time spent bugfixing, and if they're unhappy they can take their business elsewhere.
This of course puts great incentive on you to write high-quality code, because your failings in that area will be visible as bugs to the client.