Casting with a lua error