More cleanups for StackValue type checking