Here is a short but interesting list of things to do to avoid lawsuits.
"Eight steps to safeguard your business
Professional contract agreements.
Documentation and tracking changes.
Checking work.
Communications with the client.
Early recognition of potential disputes.
Early recognition of potential disputes.
Meeting budgets
Costs.
Time.
Fees and charges