Fix object initialization in browser context