First revision of compatibility changes

Users can now login. Several others fixes pending.