Removed leaks in case of non-optimized strings