Fix and handle exceptions in firefox 3.5.5