Fixing git tests and adjusted some exception handling