Fix JS objects dirtying global scope