Fixes potential memory leaks with uttype use