Thanks, Greg! Right on the money. Back in the 1980s, when I ran a branch of a software development consulting firm, we made it clear in the contract that we were giving a time and materials estimate and that the client should budget at least 20% more to account for surprises. Worked most of the time to keep both sides happy. We were also religious about documenting changes of scope and getting customer sign off on them.
The company also had an 80-hour rule. No individual task could exceed 80 hours and was either 0% or 100% complete. No 50% or 80% wishful thinking complete. I have used those rules running development at ISVs ever since, so I'm still working.