Pushed to upstream

cc/ @sergiogonzalez @adolfopa.  Merged as it solves 4 tests