Index Corruptions

I previously saw a thread about index corruptions being the cause of a
'master record missing' problem. How can index corruptions be prevented?
How can I fix an index corruption from my application?

Thanks!

Tracy Jenkins
Moldflow Corporation