Minor bugfix. Stopped a resource leak.