changes from master

Also correct for XS API changes