fixing a bug with $self boxing for stack allocated objects