Rewrote code close all open resources correctly after commit.
Merge pull request #58 from Luis-Cruz/develop

Rewrote code close all open resources correctly after commit.