Some improvements to be compatible with the version 3