Cast to type, not variable name
Wow this was a mess.