Final tests/changes for making it work for Ivan