Trying to dynamically set type to class, failing.