fix 'fatal: reference is not a tree' errors