Changes to make compatible with R's RLM