Fix the problem, not the blame
It doesn't matter if the bug is your fault or someone else's. It's still your problem.
Always try to discover the root cause of a problem, not just this particular appearance of it.
The best way to start fixing a bug is to make it reproducable.
Failing test before fixing code
When you come across a surprise but, you need to determine why this failure wasn't caught earlier.
If you find yourself surprised by a bug, then probably there are assumptions that are wrong.
Don't assume it - prove it
If it took a long time to fix this bug, ask yourself why. Is there anything you can do to make fixing this bug easier the next time around?