Avoid deprecated FileBody constructors and clear up reflection warning.