Fix changes pulled from v2.1.x for new API