Fixed issue which stoped type aliases being properly encoded