Fixed handling of bracket auto-closing on Windows