Fix #766

Add missing close