more fixes to cope with API changes.

manually tested.