Fix tests and rebuild phar