Fix a resource leak and add a new no URL decap feature