Applied patch by Pau Ortega