Fixes bug 828906 - Remove obsolete code using branches table.

@lonnen @twobraids r?