fix regression that caused freeInstance not to be correctly called

was introduced July, 5th 2013 by commit 8ee2b0b1610fbf4dff20453d188f379583410b42