Fix 500 errors on CastError.