Added some robustitude to gitlib.