Fixing CORS bug

As mentioned in #364.