Don't use deprecated APIs

Fix for #7