Fix /metadata/ redirect and make tests sensible.