Fix for fatal: ref HEAD is not a symbolic ref
Cleanup