Fixed panic handling.