Made it work in browser and server-side (for tests).