Fixes bug in managing userdata script return value