Added panic handler used to catch lua errors.