Remove calls to deprecated APIs

Closes #381