Fix handling of aliases in streamable repos, fixes #1776, fixes #1749