Fixed crash when accessing undefined variable