Fixes to make it compile with the current version of the API