Fixed issue with URL_ENCODER encoding (and small optimization)