Fixed resource leak.