Restored missing resource release calls.