Fix bug related to relation aliases

When a class had a mix of relations available some with aliases and some
without only the aliased relations would be accessible.