fix native module constructor

Would have cached the values in the wrong place.