Fix crash bug when raising error from code in old way.