Fixed and simplified repository calculation, works via SSH now, too