Fix detached HEAD