Adapted to newest libs, added init-repository