Make code compatible with new Object.observe spec