Plus, how to prevent them before they even happen.