Fix compatibility with latest SF