Rebase on master
Fix last failing tests and make closure happy.