Improved support for CORS