Changes to work with new relations interface.
Fix pretty printing to work with RefType and VoidType.