Fix #446: Make setting out of jsEnv (and sanitize stuff)