Changes and fixes by Javier