Bugfix: allow delivering any ref that's on a branch, more tests