Merge "Fix broken close() logic"