Commit from Cuzco on 25-jul-2014. Almost done.