Fixes use of obsolete API calls