Fix problem where references were create for primitive types