Fix test fails in older Safari and cleanup `setProperty` in test.js.