Fixes the clangbuild and adds conversion mechanism for custom types.