DB resource leak fix. Fixed #14