Attempting to fix a possible resource leak.