Fixed issues with getTypeValue

When generating a random var, it creates a variable object to store it
in.