Remove calls to deprecated APIs

Closes #380
Closes #381