Added changes from Javier.