Ensure the inputs are casted into expected types.